<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>新闻发布系统</title>
    <link rel="stylesheet" type="text/css" href="../layui-v2.9.10/layui/css/layui.css"/>
    <style>
        body {
            background-color: #f5f5f5;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            margin: 0;
            padding: 0;
        }
        .layui-header {
            background-color: #303030;
            color: #fff;
            padding: 0 15px;
        }
        .layui-header .layui-logo {
            font-size: 24px;
            line-height: 60px;
            margin-right: 30px;
        }
        .layui-side, .layui-layout-admin .layui-body, .layui-footer {
            background-color: #f5f5f5;
            color: #333;
        }
        .layui-card-header {
            background-color: #303030;
            color: #fff;
        }
        .layui-card-body {
            background-color: #fff;
            color: #333;
        }
        .layui-layout-admin .layui-body {
            padding: 15px;
        }
        .layui-side {
            background-color: #333;
            flex-shrink: 0;
        }
        .layui-side-scroll {
            height: 100%;
            overflow: auto;
        }
        .news-list img {
            max-width: 200px;
            max-height: 200px;
        }
    </style>
</head>
<body>
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <a href="home.jsp">
            <div class="layui-logo layui-hide-xs">新闻发布系统</div>
        </a>
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item"><a href="usermanager.jsp">用户管理</a></li>
            <li class="layui-nav-item"><a href="news_publish.jsp">新闻管理</a></li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item layui-hide layui-show-sm-inline-block">
                <a href="home.jsp">
                    <img src="../image/back-image.jpg" class="layui-nav-img">
                    <%= session.getAttribute("username") %>
                </a>
                <dl class="layui-nav-child" style="color: #0C0C0C">
                    <dd><a href="home.jsp">首页</a></dd>
                    <dd><a href="info.jsp">个人信息</a></dd>
                    <dd><a href="setting.jsp">设置</a></dd>
                    <dd><a href="../home/login-2.jsp;">退出</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item" lay-header-event="menuRight" lay-unselect>
                <a>
                    <i class="layui-icon layui-icon-more-vertical"></i>
                </a>
            </li>
        </ul>
    </div>
    <div class="layui-side">
        <div class="layui-side-scroll">
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a href="usermanager.jsp">用户管理</a>
                </li>
                <li class="layui-nav-item">
                    <a href="news_publish.jsp">新闻管理</a>
                </li>
            </ul>
        </div>
    </div>
    <div class="layui-container">
        <h1>News List</h1>
        <table>
            <thead>
            <tr>
                <th>Title</th>
                <th>Author</th>
                <th>Content</th>
                <th>Image</th>
                <th>Image</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach var="news" items="${newsList}">
                <tr>
                    <td>${news.title}</td>
                    <td>${news.author}</td>
                    <td>${news.content}</td>
                    <td><img src="${pageContext.request.contextPath}/${news.image_Path}" style="text-align: center" width="80px" height="80px" alt="News Image"></td>

                </tr>
            </c:forEach>


            </tbody>
        </table>
    </div>
</div>

<script src="https://cdn.jsdelivr.net/npm/layui@2.7.2/dist/layui.js" integrity="sha384-ROO8z9rY3r6AIfpFEx8lm3nv1BuP28MN45wWLV84eC3h5LRerAlImnUb1ODkQK9Z" crossorigin="anonymous"></script>
<script>
    layui.use('table', function(){
        var table = layui.table;
    });
</script>
</body>
</html>
